# -*- coding: utf-8 -*-
"""
 @Time    : 2021/1/23 下午2:55
 @Author  : tgy
 
"""
import builtins

def test01():
    ...
    name = '111'
    if name == '111':
        # 下面就相当于 inner = (def ():xxxx),在 test01函数的本地命名空间中添加了一个key为inner，对应的值为函数对象地址
        def inner():
            ...

        print(inner.__code__)
        # print(inner.__class__)
        print(type(inner))
        inner.abc = '123'


def multi(x,y):
    return x*y

x = 10
def t1():
    ...
    x = 20
    y = 30
    def t2():
        ...
        # global x
        print(x)
        print(y)
        def t3():
            ...
            nonlocal x
            print(x)
        t3()
    t2()
    print(t2.__closure__)



if __name__ == '__main__':
    ...
    # test01()
    # print(multi(2, 4))
    # print(multi(4,"#"))
    print(globals())
    # t1()
    print(builtins is __builtins__)
